<template>
  <div class="listContainer">
    <div class="delbatch" @click="delBatch">
      批量删除
    </div>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage1"
      layout="prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
import Bus from '../../../utils/Bus'
export default {
  props:['total'],
    methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
        this.$parent.pageSize = val,
        this.$parent.getData()
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.$parent.page = val
        this.$parent.getData()
      },
      delBatch(){
        Bus.$emit('batchData')
      }
    },
    data() {
      return {
        currentPage1: 1,
      };
    }
}
</script>

<style lang="less" scoped>
  .listContainer{
    text-align: center;
    background-color: white;
    padding-top: 14px;
    position: relative;
    .delbatch{
      position: absolute;
      left: 50px;
      cursor: pointer;
    }
  }
</style>